<div style="height: 500px;overflow: auto;">
    <div class="row">
        <h3 style="text-align: center;">确定供方选定单</h3>
    </div>
    <div class="primeng-datatable-container" [busyIf]="isLoading">
        <p-table #dataTable [value]="datatablevalues" rows="{{rows}}" [paginator]="false" editMode='row' dataKey="taskForModelId"
            [lazy]="true" [scrollable]="true" ScrollWidth="100%" ScrollHeight='100%' [resizableColumns]="true">
            <ng-template pTemplate="header">
                <tr>
                    <th style="width: 100px" rowspan="2"> 操作</th>
                    <th style="width: 150px" rowspan="2">任务编号</th>
                    <th style="width: 150px" rowspan="2">产品图号 </th>
                    <th style="width: 150px" rowspan="2">产品名称</th>
                    <th style="width: 100px" rowspan="2">数量 </th>
                    <th style="width: 150px" rowspan="2">加工状态 </th>
                    <th [ngStyle]="{'width':canvasWidth+'px'}" [ngClass]="{'badCurly':true}" [attr.colspan]="suppliers.length">厂家报价
                    </th>
                    <th style="width: 250px" rowspan="2">选定厂家 </th>
                    <th style="width: 200px" rowspan="2">选定原因 </th>
                    <th style="width: 150px" rowspan="2">备注 </th>
                </tr>
                <tr>
                    <th *ngFor="let item of suppliers" style="width: 230px">
                        {{item}}
                    </th>
                </tr>
            </ng-template>
            <ng-template pTemplate="body" let-editing="editing" let-record="$implicit" let-ri='rowIndex'>
                <tr [pEditableRow]='record'>
                    <td style="width: 100px">
                        <button *ngIf="!editing" pButton type="button" pInitEditableRow icon="pi pi-pencil" class="ui-button-info"
                            (click)="onRowEditInit(record)"></button>
                        <button *ngIf="editing" pButton type="button" pSaveEditableRow icon="pi pi-check" class="ui-button-success"
                            style="margin-right: .5em" (click)="onRowEditSave(record)"></button>
                        <button *ngIf="editing" pButton type="button" pCancelEditableRow icon="pi pi-times" class="ui-button-danger"
                            (click)="onRowEditCancel(record, ri)"></button>
                    </td>
                    <td style="width: 150px">
                        <span class="m--font-boldest"> {{record.taskCode}}</span>
                    </td>
                    <td style="width: 150px">
                        <span class="m--font-boldest"> {{record.picNo}}</span>
                    </td>
                    <td style="width: 150px">
                        <span class="m--font-boldest"> {{record.taskName}}</span>
                    </td>
                    <td style="width: 100px">
                        <span class="m--font-boldest"> {{record.outsourcingAmount}}</span>
                    </td>
                    <td style="width: 150px">
                        <span class="m--font-boldest"> {{record.workStatus}}</span>
                    </td>
                    <td *ngFor="let item of suppliers; let i =index" style="width: 230px">
                        {{getSupplierQuotation(item,ri)}}
                    </td>
                    <td style="width: 250px">
                        <p-cellEditor>
                            <ng-template pTemplate="input">
                                <p-dropdown [options]="supplierItems" [autoDisplayFirst]='false' [(ngModel)]="record.supplierName"
                                    appendTo='body' baseZIndex='9999' name='supplierName' (onChange)='changesuppler($event,record)'></p-dropdown>
                            </ng-template>
                            <ng-template pTemplate="output">
                                {{record.supplierName}}
                            </ng-template>
                        </p-cellEditor>
                    </td>
                    <td style="width: 200px">
                        <p-cellEditor>
                            <ng-template pTemplate="input">
                                <input pInputText type="text" style='width:190px;' name='reason' [(ngModel)]="record.reason"
                                    required>
                            </ng-template>
                            <ng-template pTemplate="output">
                                {{record.reason}}
                            </ng-template>
                        </p-cellEditor>
                    </td>
                    <td style="width: 150px">
                        <span class="m--font-boldest"> {{record.remark}}</span>
                    </td>
                </tr>
            </ng-template>
        </p-table>
        <div class="primeng-no-data" *ngIf="rows == 0">
            {{'NoData' | localize}}
        </div>
    </div>
    <!-- <p-panel header="外包项目供方选定单" [toggleable]="true">
    <div class="row" style="overflow: auto;">
    </div>
  </p-panel>  -->
</div>
<div class="row" style="display: -webkit-box;
margin-top: 10px;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
padding: 1rem;
border-top: 1px solid #e9ecef;">
    <button [disabled]="saving" type="button" class="btn btn-primary2" (click)="closemodel()">
        <i class="fa fa-save"></i> 关闭
    </button>
    <button type="button" (click)="auditno()" class="btn btn-danger" [buttonBusy]="saving">
        <span>退回</span>
    </button>
    <button type="button" (click)="audityes()" class="btn btn-danger" [buttonBusy]="saving">
        <span>提交</span>
    </button>
</div>
